package six;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLong()) {
            long a = in.nextLong();

            long sum = 0;
            long ride = 1;

            long temp = a;
            while (temp % 10 != 0) {
                sum += temp % 10;
                temp /= 10;
            }
            temp = a;
            while (temp % 10 != 0) {
                ride *= temp % 10;
                temp /= 10;
            }

            System.out.print(sum + " " + ride);
        }
    }
}
